package mashibing.class7;

import java.util.PriorityQueue;

/**
 * @author yujiafan
 * @version 1.0.0
 * @create 2023-03-30
 */
public class Class7_Test {

    public static void main(String[] args) {
        Class7_2_Heap<Integer> heap = new Class7_2_Heap<>(Integer::compareTo);
//        HeapGreater<Integer> heap = new HeapGreater<>(Integer::compareTo);
        heap.push(5);
        heap.push(1);
        heap.push(3);
        heap.push(6);
        heap.push(4);
        while (!heap.isEmpty()){
            System.out.println(heap.pop());
        }
        System.out.println("--------------");
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>();
        priorityQueue.add(5);
        priorityQueue.add(1);
        priorityQueue.add(3);
        priorityQueue.add(6);
        priorityQueue.add(4);
        while (!priorityQueue.isEmpty()){
            System.out.print(priorityQueue.poll());
        }
    }
}
